{template '_header'}
<link href="{php echo MX_SHOP_LOCAL}static/css/plugingrant.css" rel="stylesheet">
<style>
	.page-content{width:auto;}
</style>
<div class="page-header">
    <!--<span class='pull-right'>
        <a class='btn btn-default btn-sm' href="{php echo webUrl('plugins')}">返回我的应用</a>
    </span>-->
	当前位置：<span class="text-primary">授权应用中心</span>
</div>
<div class="page-content">
	<div class="plugingrant-container">
		<div class="plugingrant-container-adv">
			<div id="myCarousel" class="grant-banner carousel slide" data-ride="carousel">
				<!-- 轮播（Carousel）指标 -->
				<ol class="carousel-indicators">
					{loop $adv $index $a}
					<li data-target="#myCarousel" data-slide-to="{$index}" class="{if $index==0}active{/if}"></li>
					{/loop}
				</ol>
				<!-- 轮播（Carousel）项目 -->
				<div class="carousel-inner" role="listbox">
					{loop $adv $index $a}
					<div class="item {if $index==0}active{/if}">
						<a href="{$a['link']}"><img src="{php echo tomedia($a['thumb'])}" width="100%" alt="{$a['advname']}"></a>
					</div>
					{/loop}
				</div>
			</div>
		</div>
		{if $package}
		<div class="plugingrant-container-package">
			<div class="plugingrant-container-package-head row">
				<span class="col-lg-6 col-md-6 col-sm-6 col-xs-6 plugin-package-head-left">超值套餐</span>
				<span class="col-lg-6 col-md-6 col-sm-6 col-xs-6 plugin-package-head-right">
					<!--<a href="javascript:void(0);" class="active">更多套餐>></a>-->
				</span>
			</div>
			<div class="plugingrant-container-package-list">
				<ul class="row plugin-package-ul">
					{loop $package $row}
					<li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
						<div class="plugin-package-list">
							<h3>{$row['text']}</h3>
							<p>{$row['desc']}</p>
							<div class="plugin-package-list-plugin row">
								{loop $row['package'] $r}
								<span class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
									<i>
										<img  onerror="this.src='{MX_SHOP_LOCAL}static/images/yingyong.png'" src="{php echo empty($r['thumb'])?'../addons/mx_shop/static/images/plugin.png': tomedia($r['thumb'])}" alt="{$r['name']}">
									</i>
								</span>
								{/loop}
							</div>
							<div class="plugin-package-list-buy">
								价格：<span>&yen;{$row['data'][0]['price']}</span><a href="{php echo webUrl('plugingrant/detail',array('id'=>$row['id'],'type'=>'package'))}">立即购买</a>
							</div>
						</div>
					</li>
					{/loop}
				</ul>
			</div>
		</div>
		{/if}
		{if count($list)>0}
		<div class="plugingrant-container-plugin" name="sort">
			<div class="plugingrant-container-package-head row">
				<span class="col-lg-2 col-md-2 col-sm-2 col-xs-2 plugin-package-head-left">全部插件</span>
				<span class="col-lg-10 col-md-10 col-sm-10 col-xs-10 plugin-package-head-right">
					<form action="./index.php" method="get" class="form-horizontal table-search" role="form">
						<input type="hidden" name="c" value="site" />
						<input type="hidden" name="a" value="entry" />
						<input type="hidden" name="m" value="mx_shop" />
						<input type="hidden" name="do" value="web" />
						<input type="hidden" name="r" value="plugingrant" />
					排序：<a href="{php echo webUrl('plugingrant',array('sort'=>'time'))}#sort" name="sort" class="{if $_GPC['sort']=='time'}active{/if}">按时间</a><a href="{php echo webUrl('plugingrant',array('sort'=>'sale'))}#sort" name="sort" class="{if $_GPC['sort']=='sale'}active{/if}">按销量</a>
						<label class="grant-screen-right-label">
							<input type="search" placeholder="输入您需要的应用名称" name="keyword" value="{$_GPC['keyword']}">
							<button type="submit" class="glyphicon glyphicon-search" id="search"></button>
						</label>
					</form>
				</span>
			</div>
			<div class="plugingrant-container-plugin-list">
				<ul class="plugingrant-plugin-list-ul row">
					{loop $list $row}
					<li class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
						<a href="{php echo webUrl('plugingrant/detail',array('id'=>$row['id'],'type'=>'plugin'))}" class="plugingrant-plugin-list">
							<img src="{php echo empty($row['thumb'])?'../addons/mx_shop/static/images/yingyong.png': tomedia($row['thumb'])}" alt="{$row['name']}" onerror="this.src='{MX_SHOP_LOCAL}static/images/yingyong.png'">
							<h3>{if !empty($row['name'])}{$row['name']}{else}{$row['pname']}{/if}</h3>
							<div class="plugingrant-plugin-list-price">
								价格：<span>&yen;{$row['data'][0]['price']}</span>
							</div>
						</a>
					</li>
					{/loop}
				</ul>
			</div>
		</div>
		{/if}
	</div>
</div>
{template '_footer'}